package Test03_answer;

import java.util.Scanner;

/**
 * 创建Employee变量数组并初始化，该数组存放各 类雇员对象的引用。
 * 利用循环结构遍历数组元素，输出各个对象的类 型,name,number,birthday,以及该对象生日。
 * 当键盘输入本月月份值时，如果本 月是某个Employee对象的生日，还要输出增加工资信息。
 * @author Administrator
 *
 */
public class PayrollSystem {

	public static void main(String[] args) {
		
		Employee[] employees = new Employee[2];
		
		MyDate b1 = new MyDate(1996,8,12);
		employees[0] = new SalariedEmployee("shiyu","15840963168",b1,3000);
		
		MyDate b2 = new MyDate(1999,12,12);
		employees[1] = new HourlyEmployee("wenwen","15815851582",b2,10,25);
		
		for (int i = 0; i < employees.length; i++) {
			System.out.println(employees[i].toString());
		}
		
		Scanner scanner = new Scanner(System.in);
		System.out.println("请输入当前月份：");
		int month = scanner.nextInt();
		
		if(month == b1.getMonth()){
			System.out.println(employees[0].getName() + "的该月工资增加100元");
		}
		
		if(month == b2.getMonth()){
			System.out.println(employees[1].getName() + "的该月工资增加100元");
		}

	}

}
